Skip to main content

Introduction to Credio Agents

What are Credio Agents?

Credio Agents are autonomous on-chain agents that watch your Stellar DeFi positions around the clock and act on your behalf when risk becomes critical. They turn OctoPos risk intelligence into real, timely execution — so your positions stay safe even while you sleep.

The first agent in the family is the Credio Agent for OctoPos — it monitors Blend Capital lending positions and automatically closes them the moment risk reaches emergency level.

Why Agents?

DeFi never sleeps. Prices move, oracles drift, pools get utilized, and a healthy position can become a liquidation candidate in minutes. Credio Agents close the gap between seeing risk and doing something about it:

  • Always on — continuous monitoring, no human in the loop
  • Fast — pre-signed exit transactions make the critical path a single network round-trip
  • Non-custodial — the agent acts from its own wallet; your keys stay yours
  • Auditable — every action is logged with full context for later review
  • Self-funded — the agent manages its own OctoPos API subscription using on-chain USDC

Core Functionalities

Risk Monitoring

Polls the OctoPos RMS API in real time for each wallet it manages. Risk levels map directly to RMS: healthy, warn, alert, emergency.

Auto-Close on Emergency

When RMS returns emergency, the agent broadcasts a pre-signed unwind transaction — repaying debt, withdrawing collateral, and swapping back to a base asset with slippage control.

Pre-Signed Transaction Cache

To minimize reaction time, the agent keeps a ready-to-submit close transaction on hand, refreshed every few minutes or whenever positions change.

X402 Subscription Self-Management

The agent pays for its own OctoPos API access through the X402 payment protocol, using Stellar USDC. Keys are renewed automatically before expiry.

Deduplication

A two-layer guard prevents the same position from being closed twice — a short-lived cooldown cache plus a permanent audit record.

Notifications (roadmap)

A notification pipeline is scaffolded for upcoming Telegram, Discord, and Slack integrations.

Technology Behind the Agent

LayerTech
RuntimeBun
Frameworkuntangled-web (DI, jobs, caching)
BlockchainStellar / Soroban, Stellar Router SDK, Blend Capital
Risk dataOctoPos RMS
PaymentsX402 protocol, Stellar USDC
StorageMongoDB (state & audit), Redis (cooldown cache)

Architecture at a Glance

┌─────────────────────────────────────────────────────────────────┐
│ Credio Agent │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Risk Monitor │───▶│ Decision │───▶│ Stellar │ │
│ │ (polling) │ │ Engine │ │ (Soroban) │ │
│ └──────┬───────┘ └──────┬───────┘ └──────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ OctoPos │ │ Pre-Signed │ │
│ │ RMS │ │ Cache │ │
│ └──────────────┘ └──────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ MongoDB │ │ Redis │ │
│ │ (state/audit)│ │ (cooldown) │ │
│ └──────────────┘ └──────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘

What It Does, End to End

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│ Poll RMS │────▶│ Evaluate │────▶│ Keep Exit │
│ │ │ Risk Level │ │ Tx Presigned│
└─────────────┘ └──────┬──────┘ └─────────────┘

emergency│

┌─────────────┐ ┌─────────────┐
│ Dedup │────▶│ Broadcast │
│ Check │ │ & Close │
└─────────────┘ └──────┬──────┘


┌─────────────┐
│ Audit │
│ & Notify │
└─────────────┘

Supported Positions

ProtocolPosition TypeAction
Blend CapitalLending (supply + borrow)Unwind: repay debt → withdraw collateral → swap to base

Additional protocols — Aquarius, SoroSwap, Phoenix, FxDAO — are on the roadmap, tracking OctoPos adapter coverage.

Relationship to OctoPos

OctoPos ComponentRole for the Agent
RMSRisk signal source
TxBTransaction proposal reference
X402 SubscriptionsPayment rail for API access

See Credio Agent for how the agent behaves, Architecture for the pieces under the hood, and Operations for deployment.